package com.digitalart.commons {
	import flash.text.TextFieldAutoSize;    
	import flash.text.AntiAliasType;        
	import flash.text.GridFitType;  
	import flash.text.TextField;    
	
	/**
	 * @author ulises.ocana
	 */
	public class TextFormatter {
		
		private static var _instance : TextFormatter;
		
		/**********************************Constructor*************************/
		
		public function TextFormatter(singleton : SingletonEnforcer) {
		}
		
		/**********************************************************************/
		
		/**********************************Methods*************************/
		
		public static function setTextFormat(textField : TextField) : void {
			textField.embedFonts=true;
			textField.condenseWhite = true;
			textField.autoSize = TextFieldAutoSize.LEFT;
			textField.selectable = false;
			textField.multiline = true;
			textField.antiAliasType = AntiAliasType.ADVANCED;
			textField.gridFitType = GridFitType.SUBPIXEL;
		}
		public static function setTextFormatNoEmbed(textField : TextField) : void {
			
			textField.condenseWhite = true;
			textField.autoSize = TextFieldAutoSize.LEFT;
			textField.selectable = false;
			textField.multiline = true;
			textField.antiAliasType = AntiAliasType.ADVANCED;
			textField.gridFitType = GridFitType.SUBPIXEL;
		}
		
		/**********************************************************************/
		/**************************Getters & Setters***************************/
		
		public static function getInstance(): TextFormatter{
			if(_instance == null){
				_instance = new TextFormatter(new SingletonEnforcer());
			}
			return _instance;
		}
	}
}
class SingletonEnforcer{}